// 个人综合得分
import {
  DatePicker,
  Descriptions,
  Input,
  Table,
  Upload,
  Button,
  InputNumber,
} from 'antd';
import request from '@/http';
import React from 'react';
import { Form } from 'antd';
import { Link } from 'react-router-dom';
import All_style from '../../index.less';

const { TextArea } = Input;
const columns = [
  {
    /**无 */
    title: '作业主题',
    dataIndex: 'title',
    key: 'title',
  },
  {
    title: '下发老师',
    dataIndex: 'operation',
    key: 'operation',
  },
  {
    title: '下发时间',
    dataIndex: 'operation_time',
    key: 'operation_time',
  },
  {
    title: '提交时间',
    dataIndex: 'explain',
    key: 'explain',
  },
  {
    title: '实际提交时间',
    dataIndex: 'explain',
    key: 'explain',
  },
  {
    title: '提交情况',
    dataIndex: 'explain',
    key: 'explain',
  },
  {
    title: '作业得分',
    dataIndex: 'explain',
    key: 'explain',
  },
  // {
  //   title: '操作',
  //   key: 'explain',
  //   render: (row:any) => (
  //     <>
  //       <Link
  //         to={{
  //           pathname: '/Teacher/Comprehensive/edit',
  //           state: { couseID: row.course_id },
  //         }}>
  //         <Button type="link">详情</Button>
  //       </Link>
  //     </>
  //   ),
  // },
];
const personEdit = (prop: any) => {
  const [data, setData] = React.useState({
    id: '',
    key: 1,
    college_name: '',
    courseId: '',
    courseName: '', //s身份证
    evaluate: '',
    major_name: '',
    responsibility: '',
    responsibilityName: '',
    role: '',
    score: '',
    sex: '',
    state: '',
    studentId: '',
    studentName: '',
    studentNo: '',
    trainingTeacherNames: '',
    teamName: '',
    teamLeaderName: '',
  });
  const [formObject] = Form.useForm();
  const [meg, setMeg] = React.useState({
    id: '',
    key: 1,
    title: '',
    studentNo: '',
    studentIdCard: '', //s身份证
    studentSex: '',
    studentEmail: '',
    studentTell: '',
    studentLogo: '',
    collegeName: '',
    majorName: '',
    gradeName: '',
    className: '',
    teacherName: '',
    teacherTell: '',
    studentName: '',
    src: '',
  });
  // 得到上个页面传参
  let courseId;
  let studentId;
  //  let id;
  if (prop.location && prop.location.state) {
    courseId = prop.location.state.courseId;
    studentId = prop.location.state.studentId;
  }
  const loadData = async () => {
    const result: any = await request.post(
      '/scoring/a_t/QueryPersonalScoreConditionDetails',
      {
        courseId: courseId,
        studentId: studentId,
      },
    );
    setData(result.data);
  };
  React.useEffect(() => {
    loadData();
  }, []);
  return (
    <div className={All_style.box}>
      <Descriptions title="个人综合得分">
        <Descriptions.Item label="姓名">{data.studentName}</Descriptions.Item>
        <Descriptions.Item label="学号">{data.studentNo}</Descriptions.Item>
        <Descriptions.Item label="责任老师">
          {data.responsibilityName}
        </Descriptions.Item>
        <Descriptions.Item label="性别">{data.sex}</Descriptions.Item>
        <Descriptions.Item label="实训老师">
          {data.trainingTeacherNames}
        </Descriptions.Item>
        <Descriptions.Item label="院系">{data.college_name}</Descriptions.Item>
        <Descriptions.Item label="专业">{data.major_name}</Descriptions.Item>
        <Descriptions.Item label="小组长">
          {data.teamLeaderName}
        </Descriptions.Item>

        <Descriptions.Item label="项目组">{data.teamName}</Descriptions.Item>
        <Descriptions.Item label="项目角色">{data.role}</Descriptions.Item>
        <Descriptions.Item label="课程">{data.courseName}</Descriptions.Item>
      </Descriptions>
      <Form>
        <Form.Item label="综合打分">
          <InputNumber
            className={All_style.inserWorkInput}
            min="0"
            max="100"
            step="0.01"
          ></InputNumber>
        </Form.Item>
        <Form.Item label="评语">
          <TextArea rows={4} style={{ width: 1130 }} showCount allowClear />
        </Form.Item>
      </Form>
      <Button className={All_style.button}>保存</Button>
      <Link to="/Teacher/Comprehensive/index">
        <Button className={All_style.button2}>返回</Button>
      </Link>
      <Table columns={columns} className={All_style.table} />
    </div>
  );
};
export default personEdit;
